// Post.java
package com.scuec.groupfive.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.Date;

@Data
public class Post {
    private Long postId;      // 自动映射post_id
    private Long userId;      // 自动映射user_id
    private String title;
    private String content;
    private Integer viewCount; // 自动映射view_count
    private Integer status;
    @JsonProperty("createTime")
    private Date createdAt;   // 自动映射created_at
    @JsonProperty("updateTime")
    private Date updatedAt;   // 自动映射updated_at
    private String tag;
    private String type;


    private Integer commentCount;
    private Integer likeCount;
    private Integer favoriteCount;


    // 添加用户信息字段
    @JsonProperty("username")
    private String username;

    @JsonProperty("avatar")
    private String avatar;

    @JsonProperty("userRole")
    private String userRole;


    //获取用户ID
    public Long getUserId() {
        return this.userId;
    }
}